package com.bt.lms.ui.page.common.action.pagecourse;

import com.bt.lms.ui.vo.PageSkipInfo;
import com.bt.lms.ui.page.course.CourseInfoList;
import javafx.event.EventHandler;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.Pane;

/**
 * 课件管理标签事件
 */
public class CoursewareLabAction implements EventHandler<MouseEvent> {

    /**
     * 界面跳转信息
     */
    public static PageSkipInfo pageSkipInfo;

    /**
     * 构造事件
     * @param pageSkipInfo 界面跳转信息
     */
    public CoursewareLabAction(PageSkipInfo pageSkipInfo) {
        CoursewareLabAction.pageSkipInfo = pageSkipInfo;
    }

    /**
     * 事件实现
     * @param event the event which occurred
     */
    @Override
    public void handle(MouseEvent event) {
        CourseInfoList pageCourse = new CourseInfoList();
        Pane pane = pageSkipInfo.getPane();
        Integer index = pageSkipInfo.getIndex();
        pane.getChildren().set(index,pageCourse);

    }
}
